/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

/**
 *
 * @author Yeezus
 */
@Entity
public class Administrador extends Funcionario implements Serializable {

    @OneToMany(mappedBy = "admin", cascade = CascadeType.REMOVE)
    private List<Farmacia> farmacias;

    @OneToMany(mappedBy = "admin", cascade = CascadeType.REMOVE)
    private List<Encomenda> encomendas;

    public Administrador() {
        encomendas = new LinkedList<>();
        farmacias = new LinkedList<>();
    }

    public Administrador(String username, String nome, String password, String email) {
        super(username, nome,GrupoFuncionario.GRUPO.Administrador, password, email);
        encomendas = new LinkedList<>();
        farmacias = new LinkedList<>();
    }

    public List<Farmacia> getFarmacias() {
        return farmacias;
    }

    public void setFarmacias(List<Farmacia> farmacias) {
        this.farmacias = farmacias;
    }

    public List<Encomenda> getEncomendas() {
        return encomendas;
    }

    public void setEncomendas(List<Encomenda> encomendas) {
        this.encomendas = encomendas;
    }

}
